package com.macro.mall.model;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * cms_member_report实体类
 *
 * @author gaodx
 *
 */
@Data
@Builder
@AllArgsConstructor
public class CmsMemberReport implements Serializable{
	/***/
    @ApiModelProperty(value = "")
	private Long id; 
	/**类型：0->商品评价；1->话题内容；2->用户评论*/
    @ApiModelProperty(value = "类型：0->商品评价；1->话题内容；2->用户评论；3->纪委会12345")
	private Integer reportType; 
	/**用户id*/
    @ApiModelProperty(value = "用户id")
	private String reportMemberName; 
	/**用户id*/
    @ApiModelProperty(value = "用户真实姓名")
	private String name;
	/**用户手机号*/
    @ApiModelProperty(value = "用户手机号")
	private String mobile;
	/***/
    @ApiModelProperty(value = "")
	private Date createTime; 
	/**订单id*/
    @ApiModelProperty(value = "订单id")
	private String reportObject; 
	/**状态：0->未处理；1->已处理*/
    @ApiModelProperty(value = "状态：0->未处理；1->已处理")
	private Integer reportStatus; 
	/**处理结果：0->无效；1->有效；2->恶意*/
    @ApiModelProperty(value = "处理结果：0->无效；1->有效；2->恶意")
	private Integer handleStatus; 
	/***/
    @ApiModelProperty(value = "详细内容")
	private String note; 
	/***/
    @ApiModelProperty(value = "原因")
	private String reason; 
	/**
	 * 实例化
	 */
	public CmsMemberReport() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */

	public CmsMemberReport(JSONObject obj) {
		this();
		if (obj.get("id") instanceof Number) {
			this.setId(((Number) obj.get("id")).longValue());
		}
		if (obj.get("reportType") instanceof Number) {
			this.setReportType(((Number) obj.get("reportType")).intValue());
		}
		if (obj.get("reportMemberName") instanceof String) {
			this.setReportMemberName((String) obj.get("reportMemberName"));
		}
		this.setCreateTime((Date) obj.get("createTime"));
		if (obj.get("reportObject") instanceof String) {
			this.setReportObject((String) obj.get("reportObject"));
		}
		if (obj.get("reportStatus") instanceof Number) {
			this.setReportStatus(((Number) obj.get("reportStatus")).intValue());
		}
		if (obj.get("handleStatus") instanceof Number) {
			this.setHandleStatus(((Number) obj.get("handleStatus")).intValue());
		}
		if (obj.get("note") instanceof String) {
			this.setNote((String) obj.get("note"));
		}
		if (obj.get("reason") instanceof String) {
			this.setReason((String) obj.get("reason"));
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getReportType() != null) {
			result.put("reportType",this.getReportType());
		}
		if (this.getReportMemberName() != null) {
			result.put("reportMemberName",this.getReportMemberName());
		}
		if (this.getCreateTime() != null) {
			result.put("createTime",this.getCreateTime());
		}
		if (this.getReportObject() != null) {
			result.put("reportObject",this.getReportObject());
		}
		if (this.getReportStatus() != null) {
			result.put("reportStatus",this.getReportStatus());
		}
		if (this.getHandleStatus() != null) {
			result.put("handleStatus",this.getHandleStatus());
		}
		if (this.getNote() != null) {
			result.put("note",this.getNote());
		}
		if (this.getReason() != null) {
			result.put("reason",this.getReason());
		}
		return result;
	}


	@Override
	public String toString() {
		return "CmsMemberReport [id=" + id + " , reportType=" + reportType + " , reportMemberName=" + reportMemberName + " , createTime=" + createTime + " , reportObject=" + reportObject + " , reportStatus=" + reportStatus + " , handleStatus=" + handleStatus + " , note=" + note + " , reason=" + reason + "  ]";
	
	}
	
	
}
